<!DOCTYPE html>
<html class="fb-ui-theme-blue main3">
<head>
	<script>
		if (top.location != self.location) {
			top.location = self.location
		}
	</script>
	<meta charset="UTF-8">
	<title>危险化学品安全监管信息平台</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge; chrome=1"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="renderer" content="webkit">
	<meta name="Author" content="lincong1987@gmail.com"/>

	<!-- IE6 BackgroundImageCache -->
	<script>
		try {
			document.execCommand("BackgroundImageCache", false, true);
		} catch (e) {
		}
	</script>
	<!-- IE6 BackgroundImageCache -->

	<!-- GLOBAL_CONFIG -->
	<script>
		var GLOBAL_CONFIG = GLOBAL_CONFIG || {};
		GLOBAL_CONFIG.contextPath = "";
	</script>
	<link rel="stylesheet" href="resource/app/css/main3.css">
</head>
<body>

<div class="wrapper" style="transform: scale(0); opacity: 0;">
	<!--	<iframe src="fb-dv/zdwxy.html" frameborder="0"></iframe>-->
</div>

<div id="dev">
	<label>开发模式</label>
	<input type="checkbox" id="isDev">

	<label>放大</label>
	<select id="scale">
		<option value="1">1X</option>
		<option value="2">2X</option>
		<option value="3">3X</option>
		<option value="4">4X</option>
	</select>

</div>

<script src="resource/fb.min.js"></script>
<script>
	// fb.dev(${fb.dev});
</script>
<script>
	fb.dev(true);
	// window["$FIREBIRD_CACHE$"] = {"fb.theme": "darkblack_main3"};
	fb.use(["_fbClassic_/js/layout/layout2", "_appPath_/assets/setScale"], function (layout, setScale) {
		firebird.data.set("system.title", "xxx");
		firebird.data.set("fb.theme", "skyblue_main3");
		// firebird.data.set("fb.theme", "starblue_main3");

		layout.url.logout = GLOBAL_CONFIG.contextPath + "/security/permission/logout";
		layout.tab.checkSize = function () {
		};

		//layout.init();

		layout.west.width = 186;
		layout.west.show = false;

		var timer;
		$(window).off("resize").on('resize', function () {
			clearTimeout(timer);
			timer = setTimeout(function () {
				setScale();
			}, 160);
		});


		var link = firebird.url.getParameter("link") || "zdwxy.html";

		if (link) {
			$(".wrapper").append('<iframe src="fb-dv/' + link + '" frameborder="0"></iframe>')//.append(//"src", "fb-dv/" + link);
		}


		(function () {

			if (!window.localStorage) {
				console.log("浏览器不支持localstorage");
				return false;
			}

			var isDev = localStorage.getItem("isDev");
			var scale = localStorage.getItem("scale");

			console.log("localStorage: ", isDev, scale)

			if (typeof isDev === "undefined") {
				isDev = false;
			}

			if (isDev === "true") {
				isDev = true;
			} else {
				isDev = false;
			}

			setDev(isDev);
			$("#isDev").prop("checked", isDev);


			if (typeof scale === "undefined") {
				scale = 1;
			}
			setScale(scale);

			$("#scale").val(scale);

			$("#isDev").on("click", function (e) {
				var checked = $(this).prop("checked");
				setDev(checked);
				console.log('localStorage.setItem("isDev", checked);', checked)
				localStorage.setItem("isDev", checked);
			});

			$("#scale").on("change", function (e) {
				var scale = $(this).val();
				setScale(scale);

				console.log('localStorage.setItem("scale", scale);', scale)
				localStorage.setItem("scale", scale);
			});

			function setDev(dev) {
				if (dev) {
					$("body").addClass("dev")
				} else {
					$("body").removeClass("dev")
				}
			}

			function setScale(scale) {
				$(".wrapper").removeClass("scale-1 scale-2 scale-3 scale-4").addClass("scale-" + scale);
				//$("#scale").val(scale);
			}

		})();

	});
</script>
</body>
</html>